//
// Created by xili on 2024/9/2 11:41.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int maximizeGreatness(vector<int> &nums) {
        sort(nums.begin(), nums.end());
        int i = 0;
        for (auto &it: nums) {
            if (it > nums[i]) {
                i++;
            }
        }
        return i;
    }
};